<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:14:46
 * @Description: 商品规格表，规格集合（颜色+型号），不单项（颜色/型号）处理
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-19 17:02:41
 * @FilePath: /归档/base/2021_10_19_101446_create_good_spec.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodSpec extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('good_spec', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('good_id')->comment('商品ID');
            $table->string('title', 255)->default('')->comment('规格名称');
            $table->unsignedDecimal('market_price')->default(0)->comment('市场价');
            $table->unsignedDecimal('shop_price')->default(0)->comment('店铺价格');
            $table->unsignedInteger('store')->default(0)->comment('库存');
            $table->unsignedInteger('sales')->default(0)->comment('销量');
            $table->integer('sort')->default(0)->comment('排序');
            $table->boolean('status')->default(1)->comment('1 在售，0 下架');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态 1删除 0正常');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('good_spec');
    }
}
